package com.open.custom.api.utils;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;

import java.text.DecimalFormat;
import java.util.concurrent.ThreadLocalRandom;

public class OssIdUtil {
//    public static String genUUID() {
//        DecimalFormat df = new DecimalFormat("0000");
//        return System.currentTimeMillis() + df.format(ThreadLocalRandom.current().nextInt(10000));
//    }

    public static String genUUID() {
        final String nowsStr = DateUtil.format(DateUtil.date(), DatePattern.PURE_DATETIME_MS_PATTERN);
        DecimalFormat df = new DecimalFormat("0000");
        return nowsStr + df.format(ThreadLocalRandom.current().nextInt(10000));
    }
}